package com.ruoyi.controller;

import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.domain.TPersonProjectPerformance;
import com.ruoyi.service.ITPersonProjectPerformanceService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 个人项目业绩(项目库的负责人)Controller
 * 
 * @author ruoyi
 * @date 2024-11-06
 */
@RestController
@RequestMapping("/talent/performance")
public class TPersonProjectPerformanceController extends BaseController
{
    @Autowired
    private ITPersonProjectPerformanceService tPersonProjectPerformanceService;

    /**
     * 查询个人项目业绩(项目库的负责人)列表
     */
//    @PreAuthorize("@ss.hasPermi('system:performance:list')")
    @GetMapping("/list")
    public TableDataInfo list(TPersonProjectPerformance tPersonProjectPerformance)
    {
        startPage();
        List<TPersonProjectPerformance> list = tPersonProjectPerformanceService.selectTPersonProjectPerformanceList(tPersonProjectPerformance);
        return getDataTable(list);
    }

    /**
     * 获取个人项目业绩(项目库的负责人)详细信息
     */
    @PreAuthorize("@ss.hasPermi('system:performance:query')")
    @GetMapping(value = "/{id}")
    public TableDataInfo getInfo(@PathVariable("id") Long id)
    {
        List<TPersonProjectPerformance> list = tPersonProjectPerformanceService.selectTPersonProjectPerformanceById(id);
        return getDataTable(list);
    }
    /**
     * 导出个人项目业绩(项目库的负责人)列表
     */
    @PreAuthorize("@ss.hasPermi('system:performance:export')")
    @Log(title = "个人项目业绩(项目库的负责人)", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, TPersonProjectPerformance tPersonProjectPerformance)
    {
        List<TPersonProjectPerformance> list = tPersonProjectPerformanceService.selectTPersonProjectPerformanceList(tPersonProjectPerformance);
        ExcelUtil<TPersonProjectPerformance> util = new ExcelUtil<TPersonProjectPerformance>(TPersonProjectPerformance.class);
        util.exportExcel(response, list, "个人项目业绩(项目库的负责人)数据");
    }



}
